package com.ruoyi.web.wuliu.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.wuliu.mapper.TLeaveMessageMapper;
import com.ruoyi.web.wuliu.domain.TLeaveMessage;
import com.ruoyi.web.wuliu.service.ITLeaveMessageService;

/**
 * 留言Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-05
 */
@Service
public class TLeaveMessageServiceImpl implements ITLeaveMessageService 
{
    @Autowired
    private TLeaveMessageMapper tLeaveMessageMapper;

    /**
     * 查询留言
     * 
     * @param id 留言主键
     * @return 留言
     */
    @Override
    public TLeaveMessage selectTLeaveMessageById(Integer id)
    {
        return tLeaveMessageMapper.selectTLeaveMessageById(id);
    }

    /**
     * 查询留言列表
     * 
     * @param tLeaveMessage 留言
     * @return 留言
     */
    @Override
    public List<TLeaveMessage> selectTLeaveMessageList(TLeaveMessage tLeaveMessage)
    {
        return tLeaveMessageMapper.selectTLeaveMessageList(tLeaveMessage);
    }

    /**
     * 新增留言
     * 
     * @param tLeaveMessage 留言
     * @return 结果
     */
    @Override
    public int insertTLeaveMessage(TLeaveMessage tLeaveMessage)
    {
        tLeaveMessage.setCreateTime(DateUtils.getNowDate());
        return tLeaveMessageMapper.insertTLeaveMessage(tLeaveMessage);
    }

    /**
     * 修改留言
     * 
     * @param tLeaveMessage 留言
     * @return 结果
     */
    @Override
    public int updateTLeaveMessage(TLeaveMessage tLeaveMessage)
    {
        return tLeaveMessageMapper.updateTLeaveMessage(tLeaveMessage);
    }

    /**
     * 批量删除留言
     * 
     * @param ids 需要删除的留言主键
     * @return 结果
     */
    @Override
    public int deleteTLeaveMessageByIds(Integer[] ids)
    {
        return tLeaveMessageMapper.deleteTLeaveMessageByIds(ids);
    }

    /**
     * 删除留言信息
     * 
     * @param id 留言主键
     * @return 结果
     */
    @Override
    public int deleteTLeaveMessageById(Integer id)
    {
        return tLeaveMessageMapper.deleteTLeaveMessageById(id);
    }
}
